package cn.fl.risknew.transform;

import cn.cmm.base.framework.utils.CollectionUtils;
import cn.fl.overdue.dto.OverdueCapFundDTO;
import cn.fl.risknew.vo.OverdueCapFundVO;

import java.util.ArrayList;
import java.util.List;

/**
 * 作者:hongyanbo
 * 时间:2018/8/23
 */
public class OverdueCapFundVOTransform {

    public static OverdueCapFundVO toVO(OverdueCapFundDTO dto){
        OverdueCapFundVO po = null;
        if(dto != null){
            po = new OverdueCapFundVO();
            po.setAcceptCode(dto.getAcceptCode());
            po.setAcceptDate(dto.getAcceptDate());
            po.setAcceptName(dto.getAcceptName());
            po.setAmount(dto.getAmount());
            po.setCode(dto.getCode());
            po.setComeCode(dto.getComeCode());
            po.setComeName(dto.getComeName());
            po.setId(dto.getId());
            po.setOverdueDay(dto.getOverdueDay());
        }
        return po;
    }

    public static OverdueCapFundDTO toDTO(OverdueCapFundVO po){
        OverdueCapFundDTO dto = null;
        if(po!=null){
            dto = new OverdueCapFundDTO();
            dto.setAcceptCode(po.getAcceptCode());
            dto.setAcceptDate(po.getAcceptDate());
            dto.setAcceptName(po.getAcceptName());
            dto.setAmount(po.getAmount());
            dto.setCode(po.getCode());
            dto.setComeCode(po.getComeCode());
            dto.setComeName(po.getComeName());
            dto.setId(po.getId());
            dto.setOverdueDay(po.getOverdueDay());
        }
        return dto;
    }

    public static List<OverdueCapFundDTO> toDTOList(List<OverdueCapFundVO> poList){
        List<OverdueCapFundDTO> dtoList = new ArrayList<>();
        if(CollectionUtils.isNotEmpty(poList)){
            for (OverdueCapFundVO po : poList) {
                dtoList.add(toDTO(po));
            }
        }
        return dtoList;
    }

    public static List<OverdueCapFundVO> toVOList(List<OverdueCapFundDTO> dtoList){
        List<OverdueCapFundVO> poList = new ArrayList<>();
        if(CollectionUtils.isNotEmpty(dtoList)){
            for (OverdueCapFundDTO dto : dtoList) {
                poList.add(toVO(dto));
            }
        }
        return poList;
    }
}
